<div class="page field-section" data-page="undoneCargoRecord" id="undoneCargoRecord">
	<div class="page-header">
		<label>当前位置：</label>
		<a href="javascript:void(0)" class="newTaskList" id="">收货理货</a>&nbsp;&gt;&nbsp;详情
	</div>
	<div class="page-content">
		<div class="page-content-main">
			<div class="page-content-main-header">
				<div class="page-content-main-header-item taskDetail"><b style="color: #000;">理货任务信息</b></div>
				<span class="bar">|</span>
				<div class="page-content-main-header-item undoneCargoRecord"><b style="color: #FF7344;">理货记录</b></div>
				<div class="page-content-main-header-item fr">
					<!--<div class="page-content-button none tallyListGenerate">生成理货单</div>-->
					<div class="page-content-button none acceptTasks">接受任务</div>
				</div>
				<div class="line-gray">
					<img src="../../../res/images/icon/markPage.png" style="margin-left: 130px;" />
				</div>
			</div>

			<div class="page-content-main-content">

				<div class="page-content-search tallying-search">
					<div class="page-content-search-item deleteWidth">
						理货单号：<input class="input-phoneNum" type="text" placeholder="理货单号" name="tallyingNumber" id="tallyingNumber" />
						运单号：<input class="input-phoneNum" type="text" placeholder="运单号" name="waybillNumber" id="waybillNumber" />
						箱号：<input class="input-phoneNum" type="text" placeholder="箱号" name="caseNumber" id="caseNumber" />
						<div class="page-content-search-item deleteWidth">理货状态：
							<select class="isApprove" name="tallyingState" id="tallyingState">
								<option value="">所有</option>
								<option value="0">未知</option>
								<option value="1">待理货</option>
								<option value="2">不接受</option>
								<option value="3">已接受</option>
								<option value="4">已完成</option>
							</select>
						</div>
					</div>

					<button class="search-item-button" id="tallying_search">搜索</button>
					<div class="clear"></div>
				</div>

				<div class="page-content-main-content-item">
					<div class="content">

					</div>
					<div class="pagerCon"></div>
					<script type="text/template" id="cargoRecordTpl">
						{@each datas as it}
						<table class="table cargoRecordTable">
							<thead>
								<tr class="tr_style table-data" tallyingId="${it.tallyingId}">
									<th colspan="3" style="width: 300px;height: 56px;">理货单号: <a class="tallyingNumber">${it.tallyingNumber}</a></th>
									<th>完成时间:${it.finishedDateTime}</th>
									<th></th>
									<th>理货员:${it.clerkName}</th>
									<th>状态： {@if it.tallyingState===0} 未知 {@else if it.tallyingState===1} {@if (new Date().getTime()-new Date((it.createDateTime).replace(new RegExp("-","gm"),"/")).getTime())>(6*60*60*1000)}
										<label class="requiredInput">长时间未接受任务</label>
										{@else} 待理货 {@/if} {@else if it.tallyingState===2} 未接受 {@else if it.tallyingState===3} 已接受 {@else if it.tallyingState===4 } 已完成 {@else if it.tallyingState===5 } 已上报 {@/if}
									</th>
									<th colspan="3">
										<!--<label class="button_tally" />-->
										{@if it.financeId != 0} 
										<a href="javascript:void(0);" class="sync">同步</a>
										{@/if}
										{@if it.tallyingState==0} {@else if it.tallyingState==1}
										<label class="button_update" />
										<label class="button_confirm" /> {@else if it.tallyingState==2}
										<label class="button_update" /> {@else if it.tallyingState==3} {@if it.userDefined===0} {@else if it.userDefined===1}
										<!--<label class="button_tally" />--> {@/if}
										{@if it.financeId != 0}
										<label class="button_finish" /> 
										{@/if}
										{@else if it.tallyingState==4} {@if it.supervisionState===0}
										{@if it.financeId != 0}
										<label class="button_report" />
										{@/if}
										 {@else} {@if it.abnormal===0}
										<label class="button_unusual" /> {@/if} {@/if} {@/if}
									</th>
								</tr>
							</thead>
							<tbody class="tallyingTable">
								<tr class="tableTr">
									<td>序号</td>
									<td>箱号</td>
									<td>箱型尺寸</td>
									<td>运单号</td>
									<td>理货时间</td>
									<td>异常标记</td>
									<td>铅封号</td>
									<td>理货状态</td>
									<td>监管状态</td>
									<td>操作</td>
								</tr>
								{@each it.containerInventorys as that}
								<tr driverAddress="${it.driverAddress}" class="tr_style table-data" inventoryId="${that.inventoryId}" waybillNumber="${that.waybillNumber}" caseNumber="${that.caseNumber}" inventoryHistoryId="${that.inventoryHistoryId}" tallyingId="${it.tallyingId}">
									<td class="index">
									</td>
									<td>{@if that.abnormal === 0}
										<img style="vertical-align: top;" alt="exclamation" src="../../../res/png/exclamation.png" /> ${that.caseNumber}
										{@else}
										${that.caseNumber}
										{@/if}
									</td>
									<td>${that.caseSize}</td>
									<td>${that.waybillNumber}</td>
									<td>${that.tallyDateTime}</td>
									<td>${getValueByKey(10, that.abnormal)}</td>
									<td>${that.facingSlip}</td>
									<td>
										{@if that.tallyingState==0} 待理货 {@else if that.tallyingState==1} 已理货 {@/if}
									</td>
									<td>
										${getValueByKey(5, that.supervisionState)}
									</td>
									<td>
										{@if that.tallyingState==0}
											<a class="detail">&nbsp;理货&nbsp;&nbsp;
												<img src="../../../res/png/arrow1_icon.png">
												<div class="hideBtn">
													<div class="tallyingA ff1" style="left: 13px;">&nbsp;&nbsp;理货&nbsp;&nbsp;
														<img src="../../../res/png/arrow2_icon.png">
													</div>
													<div class="tallyingDetail ff2">查看&nbsp;&nbsp;&nbsp;&nbsp;
													</div>
												</div>
											</a>
										{@else}
											<a class="tallyingDetail" href="javascript:void(0)">详情</a> 
											{@if it.financeId == 0}
											<a class="tallyingAdjust" href="javascript:void(0)">调整</a> &nbsp; <a class="delete-type" href="javascript:void(0)">删除</a>  
											{@/if}
										{@/if}
										{@if it.financeId != 0}
										{@if it.tallyingState<5} 
											{@if that.tallyDateTime==='' } 
											{@else}
											<a class="button_unusualReport">异常上报</a> 
											{@/if} 
										{@else}
										<a class="createAbnormalLink">标记异常</a> 
										{@/if}
										{@/if}
									</td>
								</tr>
								{@/each}
							</tbody>
						</table>
						{@/each}
					</script>
				</div>
			</div>
		</div>
	</div>
	<div id="fullBg" class="fullBg none"></div>
	<div id="reportTask-dialog" class="dialog adddialog none" style="margin-top: -170px; margin-left: -325px;">
		<div class="dialogTitle">上报理货任务</div>
		<button class="closeDiv">×</button>
		<div class="dialogContent">
			确定要上报此理货任务吗？
		</div>
		<div class="footerBtn">
			<div id="sureReportTask" class="dialogBtn dialogHandlerBtn">确定</div>

		</div>
	</div>

	<div id="confirmTask-dialog" class="dialog adddialog none" style="margin-top: -170px; margin-left: -325px;">
		<div class="dialogTitle">确认理货任务</div>
		<button class="closeDiv">×</button>
		<div class="dialogContent confirmTask" action="confirmTallying" version="v1.0">
			确定要接受此理货任务吗？
			<input type="hidden" name="tallyingId" />
		</div>
		<div class="footerBtn">
			<div id="sureUpdFirst" class="dialogBtn dialogHandlerBtn">确定</div>
		</div>
	</div>
	<div id="finishedTask-dialog" class="dialog adddialog none" style="margin-top: -170px; margin-left: -325px;">
		<div class="dialogTitle">理货完成</div>
		<button class="closeDiv">×</button>
		<div class="dialogContent finishedTask" action="finishedTallying" version="v1.0">
			确定要完成此理货任务吗？
			<input type="hidden" name="tallyingId" />
		</div>
		<div class="footerBtn">

			<div id="surefinished" class="dialogBtn dialogHandlerBtn">确定</div>
		</div>
	</div>
	<div id="unusualReportTask-dialog" class="dialog unusualReportTask_dialog none" style="margin-top: -170px; margin-left: -325px;">
		<div class="dialogTitle">理货异常上报</div>
		<button class="closeDiv">×</button>
		<div class="dialogContent unusualReportTask" action="supplementAbnormalContainerTallying" version="v1.0">
			<p>
				<span><span class="requiredInput">*</span>异常理货地点：
				<input type="text" isNull="1" codeName="异常理货地点" maxlength="255" name="tallyExAddress" />
				</span>
				<span><span class="requiredInput">*</span>异常理货类型：
				<select name="tallyExAbnormalState">
					<option value="1">货损</option>
					<option value="2">丢失</option>
				</select>
				</span>
			</p>
			<p>
				<span><span class="requiredInput">*</span>理货异常说明：
				<textarea name="tallyExRemark" class="field-input abnormalComment" isNull="1" codeName="理货异常说明" maxlength="255"></textarea>
				</span>
			</p>
			<div>
				录音文件:
				<input type="hidden"  name="tallyExSoundRecorde" id="soundRecorde" />
				<p>
					<label for="uploadFileSoundRecorde" class="file uploadFileSoundRecorde"> 上传录音文件
						<input type="file" class="uploadFileInput2" name="file" id="uploadFileSoundRecorde" />
					</label>
				</p>
			</div>
			<div>
				异常图片:
				<input type="hidden" isNull="1" codeName="异常图片" name="tallyExAbnormalFile" id="abnormalFile" />
				<p>
					<label for="uploadFileAbnormalFile" class="file uploadFileAbnormalFile"> 上传异常图片
						<input type="file" class="uploadFileInput2" name="file" id="uploadFileAbnormalFile" accept=".png,.jpg,.bmp" />
					</label>
				</p>
			</div>
			<input type="hidden" name="tallyingId" />
			<input type="hidden" name="inventoryHistoryId" />
			<input type="hidden" name="abnormal" value="0" />
		</div>
		<div class="footerBtn">

			<div id="sureabnormal" class="dialogBtn dialogHandlerBtn">确定</div>
		</div>
	</div>
</div>